import 'package:flutter/material.dart';
import 'package:flutter01/GetX/getController/shopController.dart';
import 'package:get/get.dart';

class ShopView extends GetView<ShopController>{
  const ShopView({super.key});


  @override
  ShopController get controller {
    return GetInstance().find<ShopController>();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("GetView"),
      ),
      body: Center(
        child: Column(
          children: [
            Obx(() => Text("${controller.counter}")),
            ElevatedButton(
              onPressed: (){
                controller.inc();
              },
              child: const Text("加一")
            )
          ],
        ),
      ),
    );
  }

}
